﻿using System;
using System.Collections.Generic;
using Web7.Dispose;

namespace Web7.Ioc
{
    /// <summary>
    /// 所有依赖解析器应该继承它，以确保正确的构造
    /// </summary>
    public abstract class AbstractWeb7DependencyResolver : DisposableObject
    {
        protected IWeb7DependencyResolver Web7DependencyResolver { get; private set; }

        protected AbstractWeb7DependencyResolver(IWeb7DependencyResolver web7DependencyResolver)
        {
            Web7DependencyResolver = web7DependencyResolver;
        }

        public abstract T Resolve<T>();
        public abstract IEnumerable<T> ResolveAll<T>();
        public abstract T Resolve<T>(string name);
        public abstract object Resolve(Type type);
        public abstract IEnumerable<object> ResolveAll(Type type);
        public abstract object Resolve(Type type, string name);
    }
}
